Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkp/pkp-lib#10511 menu item of type series without content even when they exist in the OMP 3.4 #1763

Open
wants to merge 1 commit into
base: stable-3_4_0
Choose a base branch
from

Conversation

YvesLepidus
Copy link

This PR fixes a bug with the display of series without content when trying to add a series-type menu item in OMP 3.4.

Related issue: pkp/pkp-lib#10511

…rt a menu item with the series type.

Signed-off-by: yves <[email protected]>
Comment on lines +48 to +52

$seriesTitles = [];
foreach ($series as $seriesObj) {
$seriesTitles[$seriesObj->getId()] = $seriesObj->getLocalizedTitle();
}
Copy link
Contributor

@jonasraoni jonasraoni Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the previous code can be kept, but fixed. Please, apply the fix below (there's a button somewhere on the GitHub interface 🙃).

Suggested change
$seriesTitles = [];
foreach ($series as $seriesObj) {
$seriesTitles[$seriesObj->getId()] = $seriesObj->getLocalizedTitle();
}
$seriesTitles = $series->mapWithKeys(fn (Section $seriesObj) => [
$seriesObj->getId() => $seriesObj->getLocalizedTitle()
])->all();

Copy link
Contributor

@jonasraoni jonasraoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small update regarding code style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[OMP] Fatal error when creating a series menu item without content
2 participants